import java.util.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86187
 * Date: 2022-10-09
 * Time: 19:19
 */
public class Test2 {

    public static String toDelete(StringBuilder s1,StringBuilder s2) {

        if(s2 == null && s1 != null) return s1.toString();
        if(s1 == null) return null;
        int j = 0;
        Map<Character,Integer> map = new HashMap<>();

        while(j < s2.length()) {
            map.put(s2.charAt(j++),1);
        }

        int i = 0;
        while(i < s1.length()) {
            if(map.containsKey(s1.charAt(i))) {
                s1.deleteCharAt(i);
            } else {
                ++i;
            }
        }
        return s1.toString();
    }

    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);

//        StringBuilder s1 = new StringBuilder(scanner.nextLine());
//        StringBuilder s2 = new StringBuilder(scanner.nextLine());
        StringBuilder s1 = new StringBuilder("hello world my lover");
        StringBuilder s2 = new StringBuilder("helomv");

        System.out.println(toDelete(s1, s2));
    }


    /**
     * 题解: 思路大致一致.
     */
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        String str1 = scan.nextLine();//They are students.
        String str2 = scan.nextLine();//aeiou

        HashMap<Character,Integer> map = new HashMap<>();
        for(int i = 0;i < str2.length();i++) {
            char ch = str2.charAt(i);
            if(map.get(ch) == null) {
                map.put(ch,1);
            }else {
                map.put(ch,map.get(str2.charAt(i))+1);
            }
        }

        StringBuilder ret = new StringBuilder();
        for(int i = 0;i < str1.length();i++) {
            if(map.get(str1.charAt(i)) == null) {
                ret.append(str1.charAt(i));
            }
        }
        System.out.println(ret);
    }

}
